package com.sanhuo.security.entity;

import com.sanhuo.security.UserVo;

import java.util.Date;

public class BaseEntity {
    private String creatorId;
    private Date createTime;
    private String updatorId;
    private Date updateTime;

    public void updatorInfo(UserVo user){
        setUpdateTime(new Date());
        setUpdatorId(user.getId());
    }

    public void creatorInfo(UserVo user){
        setCreateTime(new Date());
        setCreatorId(user.getId());
    }

    public void creatorAndUpdatorInfo(UserVo user){
        setUpdateTime(new Date());
        setUpdatorId(user.getId());
        setCreateTime(new Date());
        setCreatorId(user.getId());
    }

    public String getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdatorId() {
        return updatorId;
    }

    public void setUpdatorId(String updatorId) {
        this.updatorId = updatorId;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
}
